package mutableclass;

import immutableclass.ImmutableEchiquier;
import immutableclass.ImmutableEchiquier.Case;
import immutableclass.ImmutableJeuDechecs;
import immutableclass.ImmutablePiece;
import java.util.ArrayList;
import java.util.Map;

public class MutablePosition {

    private final ArrayList<ImmutableEchiquier> Echiquier;
    private final ArrayList<ImmutablePiece> Pieces;
    private final Map<Case, ImmutablePiece> PositionInitiale;
    private Map<Case, ImmutablePiece> position;

    public void setPosition(Map<Case, ImmutablePiece> position) {
        this.position = position;
    }

    public static Map<Case, ImmutablePiece> getPosition() {
        return new MutablePosition().position;
    }

    private MutablePosition() {

        ImmutableJeuDechecs Boite = ImmutableJeuDechecs.getInstance();
        Echiquier = Boite.getEchiquier();
        Pieces = Boite.getPieces();
        PositionInitiale = Boite.getPositionInitiale();
        setPosition(PositionInitiale);
    }

//    @Override
//    public String toString() {
//        String ret ="";
//        for (Case _case : Case.values()) {
//           ret += _case.toString()+",";
//        }
//        return ret;
//    }
}











